using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography.Xml;

namespace CS6238Project2.Banking.Commerce
{
    [Serializable]
    public class Purchase
    {
        Good good;
        int quantity;
        int totalCost;

        /// <summary>
        /// Default constructor creates empty structure
        /// </summary>
        public Purchase()
        {

        }

        /// <summary>
        /// A constructor for a Purchase
        /// </summary>
        /// <param name="g">A Good object</param>
        /// <param name="q">Quantity of that object in the purchase</param>
        public Purchase(Good g, int q)
        {
            good = g;
            quantity = q;
            totalCost = g.Worth * q;
        }

        /// <summary>
        /// A representation of the good being ordered
        /// </summary>
        public Good Good
        {
            get { return good; }
            set { good = value; }
        }
        /// <summary>
        /// The number of goods in the purchase order
        /// </summary>
        public int Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }

        /// <summary>
        /// The total value of the goods based on their worth and quantity
        /// </summary>
        public int TotalWorth
        {
            get { return good.Worth * quantity; }
        }

    }
}
